//
//  MenuCell.m
//  shise
//
//  Created by 徐国庆 on 14/12/24.
//  Copyright (c) 2014年 MZP. All rights reserved.
//

#import "MenuCell.h"

@implementation MenuCell

- (void)dealloc
{
    [_menuOne release];
    [_menuTwo release];
    [_menuOneButton release];
    [_menuTwoButton release];
    [super dealloc];
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        self.menuOne = [[UIImageView alloc] init];
        [self.contentView addSubview:self.menuOne];
        
        self.menuTwo = [[UIImageView alloc]init];
        [self.contentView addSubview:self.menuTwo];
        
        self.menuOneButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];
        [self.contentView addSubview:self.menuOneButton];
        
        self.menuTwoButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];
        [self.contentView addSubview:self.menuTwoButton];
        
        [_menuOne release];
        [_menuTwo release];
//        [_menuOneButton release];
//        [_menuTwoButton release];
        
    }
    return self;
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    self.menuOne.frame = CGRectMake((self.contentView.frame.size.width - 290) / 3, 20, 145, 145);
    self.menuOneButton.frame = self.menuOne.frame;
    
    
    self.menuTwo.frame = CGRectMake((self.contentView.frame.size.width - 290) / 3 * 2 + 145, 20, 145, 145);
    self.menuTwoButton.frame = self.menuTwo.frame;
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
